module EmployeeCertificateJsonSerializer
  def self.as_json employee_certificate
    employee_certificate.to_json(include: [:certificate, :employee])
  end

  def self.index_json employee_certificates
    employee_certificates.map { |e| JSON.parse(as_json e) }
  end

  def self.count_json employee_certificates
    {count: employee_certificates.size}
  end

end
